package com.java.demo;

import com.java.demo.component.BeanCompont;

import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {
//        ApplicationContext context=
//                new ClassPathXmlApplicationContext("spring-config.xml");
//        UserController controller=context.getBean("userController",UserController.class);
//        controller.printUser();
//        UserController2 controller2=context.getBean("userController2",UserController2.class);
//        controller2.printUser2();


        ClassPathXmlApplicationContext  context =
                new ClassPathXmlApplicationContext("spring-config.xml");
        BeanCompont compont = context.getBean("beanCompont",BeanCompont.class);
        compont.sayHi();
        //context.destroy();
    }
}
